﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyCongDan.GUI
{
    public partial class frmDanhsachTaiKhoan : Form
    {
        public frmDanhsachTaiKhoan()
        {
            InitializeComponent();

            try
            {
                DataSet ds = DAL.DAL_TaiKhoan.GetTaiKhoanTable();
                dataGridViewTaiKhoan.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void simpleButtonUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = (DataTable)dataGridViewTaiKhoan.DataSource;
                DAL.DAL_TaiKhoan.UpdateTaiKhoanTable(dt.DataSet);
                MessageBox.Show("Hoàn tất");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
